/**
 * @param {string[][]} items
 * @param {string} ruleKey
 * @param {string} ruleValue
 * @return {number}
 */
 var countMatches = function(items, ruleKey, ruleValue) {
   let obj = {
     'type':0,
     'color':1,
     'name':2
   }
   let count = 0
   let index = obj[ruleKey]
  for(let i=0;i<items.length;i++){
    if(item[i][index]==ruleValue){
      count++
    }
  }
  return count
};